jQuery(document).ready(function($) {
    // Log page visit
    var pageId = $('[data-nx-custom-sort-page-id]').data('nx-custom-sort-page-id');
    if (pageId) {
        $.ajax({
            url: nxCustomSort.ajax_url,
            method: 'POST',
            data: {
                action: 'nx_custom_sort_log_visit',
                page_id: pageId,
                nonce: nxCustomSort.nonce
            }
        });
    }
});
